<template>
  <el-table :data="works_list" border style="width: 100%">
    <el-table-column prop="name" label="名称" width="280"> </el-table-column>
    <el-table-column prop="url" label="预览图" width="380">
      <template slot-scope="scope">
        <router-link :to="{ name: 'image_detail', params: { id: scope.row.id } }">
          <img
            :src="scope.row.url"
            alt=""
            style="max-width: 165px; max-height: 120px;"
          />
        </router-link>
      </template>
    </el-table-column>

    <el-table-column prop="tags" label="所属分类">
      <template slot-scope="scope">
        <span v-for="item in scope.row.tags" :key="item.id">
          <el-tag style="margin-right:5px">{{ item.name }}</el-tag>
        </span>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  name: "search",
  data() {
    return {};
  },
  props: ["works_list"],
  computed: {},
  methods: {},
};
</script>

<style>
</style>
